package com.uw.gateway.config;

import com.uw.gateway.handler.router.GatewayRouterHandler;
import com.uw.gateway.handler.router.HelloRouterHandler;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.server.RequestPredicates;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.RouterFunctions;

@Configuration
public class UwGatewayRouterConfig {

    //@Bean
    public RouterFunction<?> helloRouterFunction(HelloRouterHandler helloRouterHandler) {
        return RouterFunctions.route(RequestPredicates.GET("/hello"), helloRouterHandler::handle);
    }

    //@Bean
    public RouterFunction<?> gatewayRouterFunction(GatewayRouterHandler gatewayRouterHandler) {
        return RouterFunctions.route(RequestPredicates.POST("/gw/**"), gatewayRouterHandler::handle);
    }


}
